package ThreadDemo;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class C1 {

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        Callable c1 = new Callable() {
            @Override
            public String call() throws Exception {
                return "787";
            }
        };
        FutureTask<String> f1 = new FutureTask<String>(c1);
        Thread t1 = new Thread(f1);
        t1.start();
        System.out.println(f1.get());
    }
}
